package com.example.ResumeWorkPlatform.dao;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;




/**
 * @ClassName: BasicUserEntity
 * @Description: 基础用户表
 * @Author yuankaiqiang
 * @DateTime 2020-12-31 19:59:16
 */
@Entity
@Table(name ="basicUser_entity")
public class BasicUserEntity implements Serializable{
	
private static final long serialVersionUID = 1L;

	/**
	 * 数据库自增长ID
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	/**
	 * 删除标识
	 */
	private boolean delFlag = true;
	/**
	 * 员工姓名
	 */
	private String staffName;
	/**
	 * 性别
	 * (false为女/true为男)
	 */
	private Boolean sex;
	/**
	 * 员工号
	 */
	private String staffNumber;
	
	/**
	
	/**
	 * 员工账号（唯一/不能为空）
	 */
	@Column(unique = true, length = 30, nullable = false)
	private String account;
	/**
	 * 员工手机号
	 */
	@Column(unique = true, length = 11)
	private String phone;
	
	/**
	 * 员工密码（不能为空）
	 */
	@Column(length = 30, nullable = false)
	private String password;
	/**
	 * 体温
	 */
	private String  bodyTemperature;
	
	/**
	 * 创建时间
	 */
	private Date createTime = new Date();
	/**
	 * 是否已复工
	 * (false未复工/true已复工)，默认未复工
	 */
	private  Boolean workResumption = false;
	/**
	 * 是否入园扫码
	 * (false未入园/true入园)，默认未入园
	 */
	private  Boolean isWork = false;
	/**
	 * 是否健康
	 * (false不健康/true健康，默认健康
	 */
	private  Boolean isHealth = true;
	/**
	 * 是否有疫区接触史
	 * (false没有/true有)，默认没有
	 */
	private  Boolean isTouch = false;
	/**
	 * 是否回工作地
	 * (false未回/true已回)，默认未回
	 */
	private  Boolean isRturnWorkingLocation = false;
	
	/**
	 * 是否完成隔离
	 * (false隔离中/true隔离结束)，默认隔离中
	 */
	private  Boolean finishInsulate = false;
	
	/**
	 * 是否发热咳嗽
	 * (false不发热咳嗽/true发热咳嗽)，默认不发热咳嗽
	 */
	private   Boolean isFeverCough = false;
	
	/**
	 * 用户-考勤（一对多）
	 */
	@OneToMany(mappedBy = "basicUserEntity", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private  List<BoardEntity> boardEntities;

	/**
	 * 用户-复工（一对多）
	 */
	@OneToMany(mappedBy = "basicUserEntity", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private  List<WorkResumptionEntity> workResumptionEntities;

	/**
	 * 工业园区-用户（一对一）;
	 */
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	private GerdenEntity gerdenEntity;
	/**
	 * 工业园区-用户（一对一）;
	 */
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	private DepartmentEntity departmentEntity;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public boolean isDelFlag() {
		return delFlag;
	}
	public void setDelFlag(boolean delFlag) {
		this.delFlag = delFlag;
	}
	public String getStaffName() {
		return staffName;
	}
	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}
	public Boolean getSex() {
		return sex;
	}
	public void setSex(Boolean sex) {
		this.sex = sex;
	}
	public String getStaffNumber() {
		return staffNumber;
	}
	public void setStaffNumber(String staffNumber) {
		this.staffNumber = staffNumber;
	}
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getBodyTemperature() {
		return bodyTemperature;
	}
	public void setBodyTemperature(String bodyTemperature) {
		this.bodyTemperature = bodyTemperature;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Boolean getWorkResumption() {
		return workResumption;
	}
	public void setWorkResumption(Boolean workResumption) {
		this.workResumption = workResumption;
	}
	public Boolean getIsWork() {
		return isWork;
	}
	public void setIsWork(Boolean isWork) {
		this.isWork = isWork;
	}
	public Boolean getIsHealth() {
		return isHealth;
	}
	public void setIsHealth(Boolean isHealth) {
		this.isHealth = isHealth;
	}
	public Boolean getIsTouch() {
		return isTouch;
	}
	public void setIsTouch(Boolean isTouch) {
		this.isTouch = isTouch;
	}
	public Boolean getIsRturnWorkingLocation() {
		return isRturnWorkingLocation;
	}
	public void setIsRturnWorkingLocation(Boolean isRturnWorkingLocation) {
		this.isRturnWorkingLocation = isRturnWorkingLocation;
	}
	public Boolean getFinishInsulate() {
		return finishInsulate;
	}
	public void setFinishInsulate(Boolean finishInsulate) {
		this.finishInsulate = finishInsulate;
	}
	public Boolean getIsFeverCough() {
		return isFeverCough;
	}
	public void setIsFeverCough(Boolean isFeverCough) {
		this.isFeverCough = isFeverCough;
	}
	public List<BoardEntity> getBoardEntities() {
		return boardEntities;
	}
	public void setBoardEntities(List<BoardEntity> boardEntities) {
		this.boardEntities = boardEntities;
	}
	public List<WorkResumptionEntity> getWorkResumptionEntities() {
		return workResumptionEntities;
	}
	public void setWorkResumptionEntities(List<WorkResumptionEntity> workResumptionEntities) {
		this.workResumptionEntities = workResumptionEntities;
	}
	public GerdenEntity getGerdenEntity() {
		return gerdenEntity;
	}
	public void setGerdenEntity(GerdenEntity gerdenEntity) {
		this.gerdenEntity = gerdenEntity;
	}
	public DepartmentEntity getDepartmentEntity() {
		return departmentEntity;
	}
	public void setDepartmentEntity(DepartmentEntity departmentEntity) {
		this.departmentEntity = departmentEntity;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((account == null) ? 0 : account.hashCode());
		result = prime * result + ((boardEntities == null) ? 0 : boardEntities.hashCode());
		result = prime * result + ((bodyTemperature == null) ? 0 : bodyTemperature.hashCode());
		result = prime * result + ((createTime == null) ? 0 : createTime.hashCode());
		result = prime * result + (delFlag ? 1231 : 1237);
		result = prime * result + ((departmentEntity == null) ? 0 : departmentEntity.hashCode());
		result = prime * result + ((finishInsulate == null) ? 0 : finishInsulate.hashCode());
		result = prime * result + ((gerdenEntity == null) ? 0 : gerdenEntity.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((isFeverCough == null) ? 0 : isFeverCough.hashCode());
		result = prime * result + ((isHealth == null) ? 0 : isHealth.hashCode());
		result = prime * result + ((isRturnWorkingLocation == null) ? 0 : isRturnWorkingLocation.hashCode());
		result = prime * result + ((isTouch == null) ? 0 : isTouch.hashCode());
		result = prime * result + ((isWork == null) ? 0 : isWork.hashCode());
		result = prime * result + ((password == null) ? 0 : password.hashCode());
		result = prime * result + ((phone == null) ? 0 : phone.hashCode());
		result = prime * result + ((sex == null) ? 0 : sex.hashCode());
		result = prime * result + ((staffName == null) ? 0 : staffName.hashCode());
		result = prime * result + ((staffNumber == null) ? 0 : staffNumber.hashCode());
		result = prime * result + ((workResumption == null) ? 0 : workResumption.hashCode());
		result = prime * result + ((workResumptionEntities == null) ? 0 : workResumptionEntities.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BasicUserEntity other = (BasicUserEntity) obj;
		if (account == null) {
			if (other.account != null)
				return false;
		} else if (!account.equals(other.account))
			return false;
		if (boardEntities == null) {
			if (other.boardEntities != null)
				return false;
		} else if (!boardEntities.equals(other.boardEntities))
			return false;
		if (bodyTemperature == null) {
			if (other.bodyTemperature != null)
				return false;
		} else if (!bodyTemperature.equals(other.bodyTemperature))
			return false;
		if (createTime == null) {
			if (other.createTime != null)
				return false;
		} else if (!createTime.equals(other.createTime))
			return false;
		if (delFlag != other.delFlag)
			return false;
		if (departmentEntity == null) {
			if (other.departmentEntity != null)
				return false;
		} else if (!departmentEntity.equals(other.departmentEntity))
			return false;
		if (finishInsulate == null) {
			if (other.finishInsulate != null)
				return false;
		} else if (!finishInsulate.equals(other.finishInsulate))
			return false;
		if (gerdenEntity == null) {
			if (other.gerdenEntity != null)
				return false;
		} else if (!gerdenEntity.equals(other.gerdenEntity))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (isFeverCough == null) {
			if (other.isFeverCough != null)
				return false;
		} else if (!isFeverCough.equals(other.isFeverCough))
			return false;
		if (isHealth == null) {
			if (other.isHealth != null)
				return false;
		} else if (!isHealth.equals(other.isHealth))
			return false;
		if (isRturnWorkingLocation == null) {
			if (other.isRturnWorkingLocation != null)
				return false;
		} else if (!isRturnWorkingLocation.equals(other.isRturnWorkingLocation))
			return false;
		if (isTouch == null) {
			if (other.isTouch != null)
				return false;
		} else if (!isTouch.equals(other.isTouch))
			return false;
		if (isWork == null) {
			if (other.isWork != null)
				return false;
		} else if (!isWork.equals(other.isWork))
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		if (phone == null) {
			if (other.phone != null)
				return false;
		} else if (!phone.equals(other.phone))
			return false;
		if (sex == null) {
			if (other.sex != null)
				return false;
		} else if (!sex.equals(other.sex))
			return false;
		if (staffName == null) {
			if (other.staffName != null)
				return false;
		} else if (!staffName.equals(other.staffName))
			return false;
		if (staffNumber == null) {
			if (other.staffNumber != null)
				return false;
		} else if (!staffNumber.equals(other.staffNumber))
			return false;
		if (workResumption == null) {
			if (other.workResumption != null)
				return false;
		} else if (!workResumption.equals(other.workResumption))
			return false;
		if (workResumptionEntities == null) {
			if (other.workResumptionEntities != null)
				return false;
		} else if (!workResumptionEntities.equals(other.workResumptionEntities))
			return false;
		return true;
	}
	
}
